package com.lw.entity.table;

import com.mybatisflex.core.query.QueryColumn;
import com.mybatisflex.core.table.TableDef;


/**
 * 用户信息表 表定义层。
 *
 * @author lw
 * @since 2025年05月16日 00:16:41
 */
public class TbUserTableDef extends TableDef {

    private static final long serialVersionUID = 1L;

    /**
     * 用户信息表
     */
    public static final TbUserTableDef TB_USER = new TbUserTableDef();

    
    public final QueryColumn ID = new QueryColumn(this, "id");

    /**
     * 用户邮箱
     */
    public final QueryColumn EMAIL = new QueryColumn(this, "email");

    /**
     * 用户头像
     */
    public final QueryColumn AVATAR = new QueryColumn(this, "avatar");

    /**
     * 部门ID
     */
    public final QueryColumn DEPT_ID = new QueryColumn(this, "dept_id");

    /**
     * 性别((1-男 2-女 0-保密)
     */
    public final QueryColumn GENDER = new QueryColumn(this, "gender");

    /**
     * 联系方式
     */
    public final QueryColumn MOBILE = new QueryColumn(this, "mobile");

    /**
     * 微信 openid
     */
    public final QueryColumn OPENID = new QueryColumn(this, "openid");

    /**
     * 状态(1-正常 0-禁用)
     */
    public final QueryColumn STATUS = new QueryColumn(this, "status");

    /**
     * 创建人ID
     */
    public final QueryColumn CREATE_BY = new QueryColumn(this, "create_by");

    /**
     * 昵称
     */
    public final QueryColumn NICKNAME = new QueryColumn(this, "nickname");

    /**
     * 密码
     */
    public final QueryColumn PASSWORD = new QueryColumn(this, "password");

    /**
     * 修改人ID
     */
    public final QueryColumn UPDATE_BY = new QueryColumn(this, "update_by");

    /**
     * 用户名
     */
    public final QueryColumn USERNAME = new QueryColumn(this, "username");

    /**
     * 逻辑删除标识(0-未删除 1-已删除)
     */
    public final QueryColumn IS_DELETED = new QueryColumn(this, "is_deleted");

    /**
     * 创建时间
     */
    public final QueryColumn CREATE_TIME = new QueryColumn(this, "create_time");

    /**
     * 更新时间
     */
    public final QueryColumn UPDATE_TIME = new QueryColumn(this, "update_time");

    /**
     * 所有字段。
     */
    public final QueryColumn ALL_COLUMNS = new QueryColumn(this, "*");

    /**
     * 默认字段，不包含逻辑删除或者 large 等字段。
     */
    public final QueryColumn[] DEFAULT_COLUMNS = new QueryColumn[]{ID, USERNAME, NICKNAME, GENDER, PASSWORD, DEPT_ID, AVATAR, MOBILE, STATUS, EMAIL, CREATE_TIME, CREATE_BY, UPDATE_TIME, UPDATE_BY, IS_DELETED, OPENID};

    public TbUserTableDef() {
        super("", "tb_user");
    }

    private TbUserTableDef(String schema, String name, String alisa) {
        super(schema, name, alisa);
    }

    public TbUserTableDef as(String alias) {
        String key = getNameWithSchema() + "." + alias;
        return getCache(key, k -> new TbUserTableDef("", "tb_user", alias));
    }

}
